<template>
	<view>
		<view class="list-item" v-for="(item,index) in list" :key="index" @click="gotoUrl(item)">
			<view class="item-left">
				<image class="head-img" :src="item.headImg" mode=""></image>
				<view class="far">距离较远</view>
				<view class="state">
					<view class="">可预约</view>
				</view>
			</view>
			<view class="item-right">
				<view class="t_name_tag_distance flex">
					<view class="flex t_name_tag">
						<view class="uni-label-pointer">{{item.nickName}}</view>
						<view class="t_tag">{{item.jobTitle}}</view>
					</view>
					<view class="flex t_distance">
						<uni-icons type="location-filled" color="#666" size="14"></uni-icons>
						<view>19.23km</view>
					</view>
				</view>
				<view class="flex">
					<view class="t_left">
						<view class="t_certificate_order">
							<view class="flex">
								<view class="t_certificate flex iconfont">资质认证</view>
								<view class="">最近接单 49单</view>
							</view>
							<view class="t_store flex iconfont">
								<view class="">水利宫养生</view>
							</view>
						</view>
					</view>
					<button class="t_right_btn">预约</button>
				</view>
				<view class="t_photos flex">
					<view class="photos-img" v-for="(img,i) in item.recentPhoto" :key="i">
						<image :src="img" mode=""></image>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "technicianCard",
		data() {
			return {

			};
		},
		props:{
			list:{
				type:Array,
				default:()=>{
					return []
				}
			}
		},
		created() {
		},
		methods:{
			gotoUrl(item){
				this.$emit('goto',item)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.list-item {
		width: 100%;
		background-color: #666;
		box-sizing: border-box;
		background: #fff;
		padding: 24rpx 28rpx 30rpx;
		margin-bottom: 10rpx;
		display: flex;
		align-items: flex-start !important;

		.item-left {
			width: 126rpx;
			height: 126rpx;
			position: relative;
			margin-right: 20rpx;

			.far {
				width: 126rpx;
				height: 126rpx;
				background: rgba(51, 51, 51, .3);
				box-shadow: 0 0 6rpx 0 rgba(51, 51, 51, .06);
				border-radius: 30rpx 10rpx 30rpx 10rpx;
				position: absolute;
				left: 0;
				bottom: 0;
				font-size: 20rpx;
				font-weight: 400;
				color: #fff;
				text-align: center;
				line-height: 126rpx;
			}

			.state {
				position: absolute;
				left: 50%;
				bottom: 0;
				-webkit-transform: translate(-50%, 50%);
				transform: translate(-50%, 50%);

				>view {
					display: block;
					white-space: nowrap;
					font-size: 9px;
					font-weight: 400;
					color: #fff;
					width: 45px;
					height: 15px;
					text-align: center;
					line-height: 15px;
					border-radius: 7px;
					background: #5cad08;
				}
			}
		}

		.head-img {
			width: 100%;
			height: 100%;
			border-radius: 30rpx 10rpx 30rpx 10rpx;
		}
	}

	.item-right {
		flex: 1;

		.t_right_btn {
			width: 110rpx;
			height: 50rpx;
			line-height: 50rpx;
			text-align: center;
			white-space: nowrap;
			background: linear-gradient(90deg, #d7b075, #aa8050);
			border-radius: 24rpx;
			font-size: 24rpx;
			font-weight: 400;
			color: #fff;

			&::after {
				border: none;
			}
		}

		.t_left {
			flex: 1;

			.t_certificate_order {
				margin-bottom: 10rpx;
				font-size: 11px;
				font-weight: 400;
				color: #666;

				.t_store {
					color: #666;
					font-size: 24rpx;
					margin-bottom: 20rpx;

					&::before {
						content: '';
						width: 28rpx;
						height: 28rpx;
						background: url(../static/shop-icon.png) no-repeat;
						background-size: 100% auto;
						margin-right: 2px;
					}

					&::after {
						content: '\e65f';
						font-weight: bold;
						font-size: 20rpx;

					}
				}

				.t_certificate {
					font-size: 24rpx;
					font-weight: 400;
					color: #666;
					margin-right: 30rpx;

					&::before {
						content: '';
						width: 28rpx;
						height: 28rpx;
						background: url(../static/certification.png) no-repeat;
						background-size: 100% auto;
						margin-right: 2px;
					}

					&::after {
						content: '\e65f';
						font-weight: bold;
						font-size: 20rpx;

					}
				}
			}
		}

		.t_photos {
			.photos-img {
				width: 170rpx;
				height: 170rpx;
				background: #d8d8d8;
				box-shadow: 0 0 6rpx 0 rgba(0, 0, 0, .06);
				border-radius: 16rpx;
				margin-right: 16rpx;
				position: relative;

				image {
					width: 170rpx;
					height: 170rpx;
				}
			}
		}

		.t_name_tag_distance {
			margin-bottom: 16rpx;
			height: 38rpx;
			justify-content: space-between;



			.uni-label-pointer {
				font-size: 28rpx;
				font-weight: 500;
				color: #333;
				margin-right: 10rpx;
			}

			.t_tag {
				font-size: 24rpx;
				font-weight: 400;
				color: #e9560c;
			}

			.t_distance {
				font-size: 24rpx;
				font-weight: 400;
				color: #666;
			}
		}
	}
</style>
